<template>
    <div>
        <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{ path: '/home' }">系统设置</el-breadcrumb-item>
            <el-breadcrumb-item>修改密码</el-breadcrumb-item>
        </el-breadcrumb>
        <el-card>
            <el-row :gutter="20">
                <el-col :span="10">
                    <el-form ref="form" label-width="150px" size="small">
                        <el-form-item label="登录用户名">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                        <el-form-item label="登录密码">
                            <el-input v-model="form.pass"></el-input>
                        </el-form-item>
                        <el-form-item label="确认密码">
                            <el-input v-model="form.tpass"></el-input>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="primary" size="small" @click="submit">确 定</el-button>
                        </el-form-item>
                    </el-form>
                </el-col>
            </el-row>
        </el-card>

    </div>
</template>

<script>
    export default {
        name: "System_Password",
        data() {
            return {
                form: {
                    name: '',
                    pass: '',
                    tpass: '',
                },
            }
        },
        methods: {
            submit() {
                this.form = Object.assign(this.form, {key: 'user'});
                this.$axios.post('AdminApi/Config/user', this.form).then((res) => {
                    this.$message.success('成功');
                    sessionStorage.removeItem("token");
                    this.$router.push('/')
                });
            }
        }
    }
</script>

<style scoped>

</style>